# coding:utf-8

from django.conf.urls import *
from views import IPageList, IPageCreate, IPageUpdate, IPageDetail, DeleteTextRecord, CreateTextRecord, UpdateTextRecord, CreateImageRecord, UpdateImageRecord, DeleteImageRecord

urlpatterns = patterns('',
    url(r'^$', IPageList.as_view(), name="datapagesview"),
    url(r'^new/', IPageCreate.as_view(), name="datapagenew"),
    
    url ( r'^add/', CreateTextRecord.as_view(), name = "create_record" ),
    url ( r'^edit/(?P<pk>\d+)', UpdateTextRecord.as_view(), name = "edit_record" ),
    url ( r'^delete/(?P<pk>\d+)', DeleteTextRecord.as_view(), name="delete_record" ),

    url ( r'^add_image/', CreateImageRecord.as_view(), name = "create_image_record" ),
    url ( r'^edit_image/(?P<pk>\d+)', UpdateImageRecord.as_view(success_url="/data/"), name = "edit_image_record" ),
    url ( r'^delete_image/(?P<pk>\d+)', DeleteImageRecord.as_view(), name = "delete_image_record" ),

    url(r'^update/(?P<pk>\d+)', IPageUpdate.as_view(), name="datapageupdate"),
    url(r'^detail/(?P<pk>\d+)', IPageDetail.as_view(), name="datapagedetail"),
    
    url(r'^field/(?P<page_pk>\d+)/new', 'sitegear.intellect.data.views.new_textfield', name="datanewtextfield"),
)
